<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<script type="text/javascript" src="lib/vue-2.6.10.js"></script>
<body>
	<div id="app">
		<h1>{{ title }}</h1>
		
		<div v-color="c"> {{ title }}</div>

		<p v-color="'pink'">hello</p>

	</div>

	<script type="text/javascript">
		
		
		 Vue.directive('color',{
		 	inserted:function(el,param){
		 		console.log(el);
		 	
		 		el.style.color = param.value;
		 		
		 	}
		 })


		const vm = new Vue({
			data:{
				title:'自定义指令',
				c:'red'
			},
			methods:{
				
			}
		}).$mount('#app');






	</script>
</body>
</html>